//
//  KLCurrencyDAO.h
//  KLCurrency
//
//  Created by apple on 2017/12/25.
//  Copyright © 2017年 bonc. All rights reserved.
//

#import "KLBaseDAO.h"

#import "KLCurrencyEntity.h"

@interface KLCurrencyDAO : KLBaseDAO

//增加货币
+ (long long)insertModel:(KLCurrencyEntity *)model withDataBase: (FMDatabase *)db;
//查
//查询货币模型
+ (KLCurrencyEntity *)queryModelByAbbreviation:(NSString *)abbr withDataBase:(FMDatabase *)db;
+ (KLCurrencyEntity *)queryModelById:(long long)localId withDataBase:(FMDatabase *)db;
+ (KLCurrencyEntity *)queryModelByNation:(NSString *)nation withDataBase:(FMDatabase *)db;


//查询总数量
+ (long long)queryModelCountWithDataBase:(FMDatabase *)db;
//删
+ (BOOL)deleteModelWithAbbreviation:(NSString *)abbr withDataBase: (FMDatabase *)db;
+ (BOOL)deleteModelWithId:(long long)localId withDataBase: (FMDatabase *)db;

//更新主货币
+ (BOOL)updateModelWithAbbreviation:(NSString *)abbr mainValue:(BOOL)mainValue withDataBase:(FMDatabase *)db;
//更新常用货币
+ (BOOL)updateModelWithAbbreviation:(NSString *)abbr commonValue:(BOOL)commonValue withDataBase:(FMDatabase *)db;
//更新本地货币
+ (BOOL)updateModelWithNation:(NSString *)nation localValue:(BOOL)localValue withDataBase:(FMDatabase *)db;
//获取所有数据
+ (NSArray<KLCurrencyEntity *> *)queryAllModelsWithDataBase: (FMDatabase *)db;
//获取所有常用货币
+ (NSArray<KLCurrencyEntity *> *)queryCommonModelsWithDataBase: (FMDatabase *)db;
//获取所有本地货币
+ (NSArray<KLCurrencyEntity *> *)queryLocalModelsWithDataBase: (FMDatabase *)db;

//根据输入搜索条件获取搜索货币
+ (NSArray<KLCurrencyEntity *> *)querySearchModelsWithSearchText:(NSString *)text withDataBase: (FMDatabase *)db;
@end
